<div class="wp-20" ui-view="container">
    <div class="head_title">
        <a ui-sref="main.anchorTags({pageNo:1})" style="color: inherit">主播标签</a> / <span class="tit-color">标签管理</span>
    </div>
    <div class="searchWapper white-background" style="margin-top: 15px">
        <div class="form-group searchLump search-condition">
            <div class="searchTitle" style="margin-top: -4px">搜索：</div>
            <div class="col-lg-4" style="margin-left: 5px;">
                <div class="input-group input-group-sm search-input">
                    <input type="text" class="input width-150" name="keyword" ng-model="keyword" style="border-radius: inherit;" placeholder="标签名称"  ui-event="{ keyup : 'keyup($event,keyword)' }">
                    <input type="button" class="btn btn-primary" value="搜索" style="margin-top: -4px;margin-left: 20px;" ng-click="searchClick(keyword)">
                </div>
            </div>
        </div>
        <div class="form-group searchLump" style="margin-top: 15px;">
            <div class="searchTitle" style="margin-top: -4px">操作：</div>
            <div class="search-select">
                <button class="btn btn-primary" style="margin-left: 20px" ng-click="addCommonTag()">新建</button>
                <button class="btn btn-primary" style="margin-left: 6px" ng-click="selectChangeStatus(4)">启用</button>
                <button class="btn btn-primary" style="margin-left: 6px" ng-click="selectChangeStatus(2)">禁用</button>
                <button class="btn btn-primary" style="margin-left: 6px" ng-click="selectDelete()">删除</button>
            </div>

        </div>
    </div>

    <div class="white-background" style="margin:15px  0px">

        <table class="table table-bordered table-hover table-page">

            <thead>
            <tr>
                <th><input type="checkbox" id="allCheck" class="magic-checkbox" ng-model="$parent.allChecked"
                           ng-change="allCheckChange(allChecked)">
                    <label for="allCheck"></label></th>
                <th>标签_ID</th>
                <th>标签名称</th>
                <th>维度名称</th>
                <th>CP数</th>
                <th>状态</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            <tr ng-repeat="tag in tags">

                <td>
                    <input type="checkbox" id="{{$index}}" class="magic-checkbox" ng-model="tag.checked" ng-change="itemCheckedChange()">
                    <label for="{{$index}}"></label>
                </td>
                <td>
                    {{tag.anchorId}}
                </td>
                <td>
                    {{tag.anchortagName}}
                </td>
                <td>
                    {{dimensionDetail.dimensionsName}}
                </td>
                <td>
                    {{tag.cpNum}}
                </td>
                <td>
                    {{table[tag.status]}}
                </td>

                <td>
                    <a ng-click="addCommonTag(tag)" class="time-out">编辑</a>
                    <a ng-show="tag.status==4" ng-click="changeStatus(tag)" class="time-out">禁用</a>
                    <a ng-show="tag.status==2" ng-click="changeStatus(tag)" class="time-out">启用</a>
                    <a ng-click="deleteTag(tag.anchorId)" class="time-out">删除</a>
                </td>
            </tr>
            </tbody>
        </table>
    </div>

    <div class="panel-footer paging">
        <s-pagination conf="paginationConf"></s-pagination>
    </div>


    <script type="text/ng-template" id="anchorTagModal.html">

        <div class="modal-header ng-scope">
            <button type="button" class="close" ng-click="modelCancel()"><span>&times;</span></button>
            <span class="modal-title ng-binding">通用标签管理</span>
        </div>
        <form class="w5c-form demo-form"  w5c-form-validate name="commonTag">
        <div class="modal-body ng-scope">
            <div class="control-group text-align-left">
                <label class="control-label form-require w-109">维度名称：</label>
                <div class="controls modal-input">
                    {{dimensionsName}}
                </div>
            </div>

            <div class="control-group text-align-left channel-manage form-group" style="margin-bottom: 0px">
                <label class="control-label form-require w-109"><i class="red-icon">*</i>标签名称：</label>
                <div class="controls modal-input" style="margin-bottom: 6px;">
                    <input type="text" placeholder="多个标签用逗号或分号或顿号隔开" ng-model="formData.anchortagName" required
                            name="tag"  w5c-customizer="BaseValidations.checkTags(formData.anchortagName)">
                </div>
                <span ng-if="nameCheck" class="cl cr w5c-error" style="margin-left: 112px;display: inline-block;margin-top: -10px">
                    <i class="fa fa-times error" aria-hidden="true"></i>{{message}}
                </span>
            </div>

            <div class="control-group text-align-left">
                <label class="control-label form-require w-109">标签状态：</label>
                <div class="controls modal-input" style="text-align: left">
                    <label class="radio-inline iw-110">
                        <input type="radio" name="status" value="4" class="magic-radio" id="start" ng-model="formData.status">
                        <label for="start" style="top: -1px;margin: 0px 10px 0px -18px;"></label>
                        启用
                    </label>
                    <label class="radio-inline iw-110">
                        <input type="radio" name="status" value="2" class="magic-radio" id="stop" ng-model="formData.status">
                        <label for="stop" style="top: -1px;margin: 0px 10px 0px -18px;"></label>
                        禁用
                    </label>
                </div>
            </div>
        </div>

        <div class="modal-footer">
            <button class="btn btn-primary" type="button" w5c-form-submit="modelOk()">确定</button>
            <button class="btn ims-btn" type="button" ng-click="modelCancel()">取消</button>
        </div>
        </form>

    </script>


    <!--<a ui-sref="campaigns.detail({campaignsId:1})"  ui-sref-opts="{inherit:false}">aaaaa</a>-->
</div>
